using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PACKETPARSERMAX20.CORE;

namespace PACKETPARSERMAX20.CORE.DEFINITIONS
{
    public class SMSG_QUESTGIVER_OFFER_REWARD_DEF : DefinitionBase
    {

        public override bool Process()
        {
            ResetPosition();


            ulong npcGUID = ReadUInt64();
            UInt32 QuestId = ReadUInt32();
            string Title = ReadString();
            string OfferRewardText = ReadString();

            UInt32 EnbleNext = ReadUInt32();
            UInt32 UInt32_1 = ReadUInt32();                                    // unk

            UInt32 EmoteCount = ReadUInt32();                                    // Emote Count
            for (UInt32 i = 0; i < EmoteCount; i++)
            {
                UInt32 Delay = ReadUInt32();                                   // Delay Emote
                UInt32 OfferRewardEmote = ReadUInt32();
            }


            UInt32 RewChoiceItemsCount = ReadUInt32();
            for (UInt32 i = 0; i < RewChoiceItemsCount; i++)
            {

                UInt32 RewChoiceItemId = ReadUInt32();
                UInt32 RewChoiceItemCount = ReadUInt32();
                UInt32 DisplayInfoID = ReadUInt32();
            }

            UInt32 RewItemsCount = ReadUInt32();
            for (UInt16 i = 0; i < RewItemsCount; i++)
            {
                UInt32 RewItemId = ReadUInt32();
                UInt32 RewItemCount = ReadUInt32();
                UInt32 DisplayInfoID = ReadUInt32();
            }

            UInt32 RewOrReqMoney = ReadUInt32();

            // rewarded honor points. Multiply with 10 to satisfy client
            UInt32 Honor = ReadUInt32();
            UInt32 uint32_2 = ReadUInt32();                                   // unused by client?
            UInt32 RewSpell = ReadUInt32();                 // reward spell, this spell will display (icon) (casted if RewSpellCast==0)
            UInt32 RewSpellCast = ReadUInt32();              // casted spell
            UInt32 uint32_3 = ReadUInt32();                                   // unk, NOT honor
            if (ClientBuild >= 9183)
            {
                UInt32 Bonustalents = ReadUInt32();
            }
            return Validate();
        }
    }
}

